<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-us">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrom=1">
	<meta http-equiv="Cache-Control" content="no-store"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<meta http-equiv="Expires" content="0"/>
 	<%@ include file="../base.jsp" %>
	<title>药品列表</title>
	<script type="text/javascript">
	  function doReturn(url){
			if(confirm("删除后不可恢复！")){
				//如果是true，页面返回index页面
				location.href=url;
			}else{
				//如果是false，页面不做处理
			}
		}
	</script>
</head>
<body>
  <div class="con_wrap">
  	<%@ include file="../head.jsp" %>
     <div id="main">
		<form id="queryForm" action="${ctx}/input/index.do" name="queryForm" method="post" style="display: inline;">
			<div id="main">
				<dl class="section_wrap">
					<dt><h2>搜索</h2></dt>
					<dd class="dd">
						<table class="form">
							<tr>
								<td class="tit">编　号：</td>		
								<td>
									<input value="${page.number}" id="number" name="number" />
								</td>
								　
								<td class="tit">名　称：</td>		
								<td>				 
									 <input value="${page.name}" id="name" name="name" />
								</td>
							</tr>
							<tr>
								<td class="tit">数　量：</td>		
								<td>				 
									 <input value="${page.amount}" id="amount" name="amount" />
								</td>
								<td class="tit">日   期：</td>		
								<td>
									  <input type="text" class="datepicker" name="deadline" id="deadline" value="<fmt:formatDate value='${page.deadline}' pattern="yyyy-MM-dd"/>"/>
								</td>
								</tr>
								<tr>
								<td class="tit">　　</td>
								<td>
									<input name="Input" class="button blue" value="搜索" onclick="getReferenceForm(this).action='${ctx}/input/index.do'" type="submit"/>
								</td>
							</tr>
						</table>
					</dd>
				</dl>
	
	
				<dl class="section_wrap">
					<dt><h2>人员列表</h2></dt>
					<dd class="dd">
						<table class="grid">
							<thead>
							  <tr>
								<th style="text-align:center;" >id</th>
								<th style="text-align:center;" >编　号</th>
								<th style="text-align:center;" >名　称</th>
								<th style="text-align:center;" >描　述</th>
								<th style="text-align:center;" >数　量</th>
								<th style="text-align:center;" >日　期</th>
								<th style="text-align:center;" >价　格</th>
								<th style="text-align:center;">ｏｐ</th>
							  </tr>
						  </thead>
						  <tbody>
						   <c:forEach items="${page.result}" var="medical" varStatus="status">
							  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}" style="text-align:center;"  >
								<td>${medical.id}</td>
								<td>${medical.number}</td>
								<td>${medical.name}</td>
								<td>${medical.description}</td>
								<td>${medical.amount}</td>
								<td>${medical.deadline}</td>
								<td>${medical.price}</td>
								<td>
								 <c:if test="${sessionScope.sessionUeser.role==3}">
									<a href="javascript:doReturn('${ctx}/input/delete.do?id=${medical.id}')">
										<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
									</a>&nbsp;&nbsp;&nbsp;
									<a   href="${ctx}/input/show.do?id=${medical.id}">
										<span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span>
									</a>&nbsp;&nbsp;&nbsp;
									<a href="${ctx}/input/toUpdate.do?id=${medical.id}">
										<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
									</a>
								</c:if>
								</td>
							 </tr>
			  	  			</c:forEach>
						  </tbody>
						</table>
						<!--  -->
						<%@ include file="../pagebar.jsp" %>
						<input type="hidden" id="url" value="${page.url}/index.do">
					</dd>
				</dl>
			</div>
		</form>
	</div>
	<div style="height: 200px;">
</div>
	<div id="footer">
		<%@ include file="../footer.jsp" %>
	</div>
</div>
</body>
</html>	